#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    int singleNumber(vector<int>& nums) {
        unordered_map<int, int> hash;
        for (auto i : nums)
        {
            hash[i]++;
        }

        for (auto [key, val] : hash)
        {
            if (val == 1) return key;
        }

        return 0;
    }
};